/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.edu.poli.persistence.jpql.ces4j2ee.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Deiisy
 */
@Entity
@Table(name = "alimentacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Alimentacion.findAll", query = "SELECT a FROM Alimentacion a"),
    @NamedQuery(name = "Alimentacion.findById", query = "SELECT a FROM Alimentacion a WHERE a.id = :id"),
    @NamedQuery(name = "Alimentacion.findByProteinas", query = "SELECT a FROM Alimentacion a WHERE a.proteinas = :proteinas"),
    @NamedQuery(name = "Alimentacion.findByHidratos", query = "SELECT a FROM Alimentacion a WHERE a.hidratos = :hidratos"),
    @NamedQuery(name = "Alimentacion.findByGrasas", query = "SELECT a FROM Alimentacion a WHERE a.grasas = :grasas"),
    @NamedQuery(name = "Alimentacion.findByAgua", query = "SELECT a FROM Alimentacion a WHERE a.agua = :agua"),
    @NamedQuery(name = "Alimentacion.findByCarbohidratos", query = "SELECT a FROM Alimentacion a WHERE a.carbohidratos = :carbohidratos"),
    @NamedQuery(name = "Alimentacion.findBySuplemetos", query = "SELECT a FROM Alimentacion a WHERE a.suplemetos = :suplemetos"),
    @NamedQuery(name = "Alimentacion.findByPuntosimportantes", query = "SELECT a FROM Alimentacion a WHERE a.puntosimportantes = :puntosimportantes"),
    @NamedQuery(name = "Alimentacion.findByDescripcion", query = "SELECT a FROM Alimentacion a WHERE a.descripcion = :descripcion")})
public class Alimentacion implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private BigDecimal id;
    @Column(name = "proteinas")
    private String proteinas;
    @Column(name = "hidratos")
    private String hidratos;
    @Column(name = "grasas")
    private String grasas;
    @Column(name = "agua")
    private String agua;
    @Column(name = "carbohidratos")
    private String carbohidratos;
    @Column(name = "suplemetos")
    private String suplemetos;
    @Column(name = "puntosimportantes")
    private String puntosimportantes;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "alimento")
    private List<Fichastecnicas> fichastecnicasList;

    public Alimentacion() {
    }

    public Alimentacion(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getProteinas() {
        return proteinas;
    }

    public void setProteinas(String proteinas) {
        this.proteinas = proteinas;
    }

    public String getHidratos() {
        return hidratos;
    }

    public void setHidratos(String hidratos) {
        this.hidratos = hidratos;
    }

    public String getGrasas() {
        return grasas;
    }

    public void setGrasas(String grasas) {
        this.grasas = grasas;
    }

    public String getAgua() {
        return agua;
    }

    public void setAgua(String agua) {
        this.agua = agua;
    }

    public String getCarbohidratos() {
        return carbohidratos;
    }

    public void setCarbohidratos(String carbohidratos) {
        this.carbohidratos = carbohidratos;
    }

    public String getSuplemetos() {
        return suplemetos;
    }

    public void setSuplemetos(String suplemetos) {
        this.suplemetos = suplemetos;
    }

    public String getPuntosimportantes() {
        return puntosimportantes;
    }

    public void setPuntosimportantes(String puntosimportantes) {
        this.puntosimportantes = puntosimportantes;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @XmlTransient
    public List<Fichastecnicas> getFichastecnicasList() {
        return fichastecnicasList;
    }

    public void setFichastecnicasList(List<Fichastecnicas> fichastecnicasList) {
        this.fichastecnicasList = fichastecnicasList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Alimentacion)) {
            return false;
        }
        Alimentacion other = (Alimentacion) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.edu.poli.persistence.jpql.ces4j2ee.model.Alimentacion[ id=" + id + " ]";
    }
    
}
